package com.doge.walknovel.api.model

import android.graphics.Typeface
import com.doge.walknovel.business.reader.menus.ReaderHelper
import com.doge.walknovel.core.base.LoadStatus


data class TextInfo(
    val chapterId: Int,
    val textId: Int,
    val status: LoadStatus,
    val text: String,
    val size: Int = ReaderHelper.size,
    val color: String = if (ReaderHelper.light) "#333333" else "#999999",
    val typeface: Typeface = ReaderHelper.typeface,
) {
    companion object {
        fun loading(chapterId: Int): TextInfo {
            return TextInfo(chapterId = chapterId, 0, LoadStatus.LOADING, "")
        }

        fun error(chapterId: Int): TextInfo {
            return TextInfo(chapterId = chapterId, 0, LoadStatus.FAILURE, "")
        }
    }
}